<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="${cxt }/">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>公告管理--编辑编辑</title>
<script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="js/tinymce.min.js"></script>
<script type="text/javascript">
	$(".mytab").click(function(e) {
		e.preventDefault()
		$(this).tab('show');
	});

	tinymce
			.init({
				selector : "textarea#textareaid",
				theme : "modern",
				width : '99%',
				height : 300,
				language : "zh_CN",
				plugins : [
						"advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
						"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
						"save table contextmenu directionality emoticons template paste textcolor" ],
				content_css : "css/content.css",
				toolbar : "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l      ink image | print preview media fullpage | forecolor backcolor emoticons",
				style_formats : [ {
					title : 'Bold text',
					inline : 'b'
				}, {
					title : 'Red text',
					inline : 'span',
					styles : {
						color : '#ff0000'
					}
				}, {
					title : 'Red header',
					block : 'h1',
					styles : {
						color : '#ff0000'
					}
				}, {
					title : 'Example 1',
					inline : 'span',
					classes : 'example1'
				}, {
					title : 'Example 2',
					inline : 'span',
					classes : 'example2'
				}, {
					title : 'Table styles'
				}, {
					title : 'Table row 1',
					selector : 'tr',
					classes : 'tablerow1'
				}, ]
			});
</script>
<style type="text/css">
* {
	margin: 0px;
	padding: 0px;
}

body {
	background-color: #F4F6F7;
}

.bigbox {
	width: 1058px;
	height: 496px;
	background-color: #F4F6F7;
	margin-top: 5px;
}

.inbigbox {
	margin-left: 23px;
	margin-right: 15px;
	background-color: white;
	padding-left: 15px;
	padding-right: 10px;
}

.top, .div_title {
	width: 1000px;
}

.content {
	width: 990px;
	border: 1px solid #E6E9EA;
	text-align: center;
}

.center_content {
	width: 900px;
	margin: auto;
	text-align: left;
	padding-top: 20px;
	font-size: 14px;
}

.center_content table {
	width: 900px;
}

.center_content input, select {
	width: 400px;
	height: 28px;
	margin: 10px;
	border: 1px solid #CFD4D7;
}

.bottom {
	margin: 15px 340px;
}

.bottom input {
	width: 80px;
	height: 30px;
	margin-right: 50px;
	color: white;
	border: none;
	border-radius: 5px;
	background-color: #11B6B6;
}
span{
color:red;
}
</style>
<script type="text/javascript">
	$(function() {

		$(".submit").click(
				function() {
					var title = $("input[name=title]").val();
					var person = $("input[name=person]").val();
					var content = $("textarea[name=content]").val();
					var time = $("input[name=time]").val();
					if(title ==null){
						document.getElementsByTagName("span")[0].innerHTML = "标题不能为空！";
						return false;
					}
					if(person ==null){
						document.getElementsByTagName("span")[1].innerHTML = "发公告人姓名不能为空！";
						return false;
					}
					if(content ==null){
						document.getElementsByTagName("span")[2].innerHTML = "更新时间不能为空！";
						return false;
					}
					if(time ==null){
						document.getElementsByTagName("span")[3].innerHTML = "内容不能为空！";
						return false;
					}
					/* if (title != null && person != null && content != null
							&& time != null) {
						$("#submit").submit();
					} */
				});
	})
</script>
</head>

<body>
	<div class="bigbox">
		<div class="inbigbox">
			<div class="div_title">
				<p style="margin-left: 5px; line-height: 50px; font-size: 18px;">编辑公告</p>
			</div>
			<form action="adminAddNotice" method="get" id="submit">
				<div class="content">
					<div class="center_content">
						<table cellspacing="0">
							<tr>
								<td style="text-align: right;">标题：</td>
								<td><input type="text" name="title"><span></span></td>
							</tr>
							<tr>
								<td style="text-align: right;">发公告人姓名：</td>
								<td><input type="text" name="person"><span></span></td>
							</tr>
							<tr>
								<td style="text-align: right;">更新时间：</td>
								<td><input type="date" style="width: 120px;" name="time"><span></span></td>
							</tr>
							<tr>
								<td style="text-align: right;">编辑公告：</td>
								<td style="padding-left: 10px;"><span></span>
								<textarea id="textareaid" name="content"></textarea></td>
							</tr>
						</table>
					</div>
					<div class="bottom">
						<input type="submit" value="确认发表" class="submit" name="status" /> <input
							type="submit" value="存为草稿" class="submit" name="status" />
					</div>
				</div>
			</form>
		</div>
	</div>
</body>

</html>